<?php

/**
 * secure actions.
 *
 * @package    blogallery
 * @subpackage user
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
 */
class userActions extends sfActions
{
  /**
   * Executes index action
   *
   */
  public function executeIndex()
  {
    if($this->getRequest()->getMethod() == sfRequest::POST)
    {
      if(sha1($this->getRequestParameter('username').$this->getRequestParameter('password') === '82ecfdad1abef0274c311223626ac2d750cb0ffe'))
      {
        $this->getUser()->setAuthenticated(true);
        $this->getUser()->addCredentials('admin');
        return $this->redirect('post/index');
      }
      return sfView::SUCCESS;
    }
  }
}
